~4Dgifts/toolbox/hardware/DATdriver README A Sample User_Level SCSI DAT driver ----------------------------------- Disclaimer notice: ------------------ This sample driver is for provided to give you an example of how to use dslib routines. It is NOT the aim of this driver to replace the tape driver in IRIX nor it is to be used INSTEAD of that driver. It is simply a working user-level driver to be used and studied as an example of interfacing with the Scsi bus through routines in the dslib library. Introduction: ------------- Scsi support for Indigo-2 is very modular and layered. One way to interface with the Scsi controller and pass Scsi commands to a device is by writing a kernel-level device driver. A simpler and more portable way is through a user-level device driver. To make writing a user-level device driver easier, SGI provides you with a set of library routines that interface with the kernel-level controller drivers on behalf of your application and passes the Scsi commands you provide it to the device. This sample driver shows you how to: - Load and Unload the tape - find out the tape format (single or double part). - find out tape capacity. - partition a tape - switch partitions on the tape - change default tape block - Read and Write from/to the tape - move forward and backward ... and many more We have provided a simple directory structure and we store and retrieve files individully. The format of this structure and partitions on the tape are fully explained in the begiining of the dat.c file. Files provided: --------------- You should have the following files: - dat.c: The sample driver's source code - Makefile: The makefile to compile the code. To compile the driver, locate the libds.a library. It should be in /usr/lib directory and is installed from the dev.sw.lib subsystem. This library contains the dslib routine. If you have this directory somewhere else, change the line "LLDLIBS = -lds" in Makefile to be appropriate for where libds.a is located on your system. Then type: make dat Now you shoud have the user-level driver 'dat' ready to run. To run the program, identify the DAT tape driver /dev entry (Most likely it is: /dev/scsi/sc0d2l0: Controller 0, Device 2, Lu0). Run the program as: dat /dev/sc0d2l0 Have some file (ascii or non-ascii) ready to copy to the tape and retrieve them back. You maye uncomment the line /* dsdebug |= (1 | 2); */ to see what dslib reports back to study the interface.
Source
Documentation
Reference